package com.supor.aiot.common.analysis;

import com.mpaas.mas.adapter.api.MPLogger;
import com.supor.aiot.common.analysis.event.BindFailureEvent;

import java.util.Map;

/**
 * 埋点
 */
public class AnalysisTool {

    /**
     * 绑定失败埋点方法
     * @param params
     */
    public static void bindFailureEvent(Map<String, String> params) {
        bindFailureEvent(params, false);
    }

    /**
     * 绑定失败埋点方法
     * @param params
     */
    public static void bindFailureEvent(Map<String, String> params, boolean updateNow) {
        MPLogger.event(BindFailureEvent.Event.BIND_FAILURE, params);
        if (updateNow) {
            // 立即手动上报
            MPLogger.uploadAll();
        }
    }

}
